package com.easyssh.framework.web.interceptor;

import java.util.TimeZone;

import com.easyssh.framework.web.action.EasyAction;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * 
 * @ClassName: TimezoneInterceptor
 * @Description: TODO(设置时区，在Linux下部署的话，最好设置此拦截机)
 * @author liangyuanbing
 * @date 2015年12月18日 下午5:57:56
 *
 */
public class TimezoneInterceptor extends AbstractInterceptor {
	private static final long serialVersionUID = 1L;

	public String intercept(ActionInvocation invocation) throws Exception {
		TimeZone.setDefault(TimeZone.getTimeZone("GMT+0800"));
		EasyAction action = (EasyAction) invocation.getAction();
		action.setActionExecTime(System.currentTimeMillis());
		return invocation.invoke();
	}
}
